import Vue from 'vue'
import Vuex from 'vuex'
import router, {resetRoutes} from "@/router";

Vue.use(Vuex);


const store =new Vuex.Store({
    state:{
        currentPathName:''
    },
    mutations:{
        setPath(state){
            state.currentPathName=localStorage.getItem("currentPathName")
        },
        logout(){
            localStorage.removeItem("user");
            localStorage.removeItem("menus");
            router.push("/login").then(r => {});

            resetRoutes();
        }
    }
})
export default store